package com.example.vv.model.setup;

import android.content.Context;
import android.view.View;

import com.example.vv.R;
import com.example.vv.fragmentWork.mvp.MvpFragment;
import com.example.vv.model.setup.base.adapter.PagerAdapter;
import com.example.vv.model.setup.base.contract.SetupContract;
import com.example.vv.model.setup.base.presenter.SetupPresenter;
import com.example.vv.model.setupItem.SetupItemFragment;
import com.example.vv.model.setupTree.SetupTreeFragment;
import com.google.android.material.tabs.TabLayout;

import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;


public class SetupFragment extends MvpFragment<SetupContract.View, SetupPresenter> implements SetupContract.View {


    @BindView(R.id.setup_layout)
    TabLayout setupLayout;
    @BindView(R.id.setup_pager)
    ViewPager setupPager;

    @Override
    public int initLayout() {
        return R.layout.fragment_setup;
    }

    @Override
    public SetupPresenter initPresenter() {
        return new SetupPresenter();
    }

    @Override
    public void initView() {

    }

    @Override
    public void lazyLoad() {
        PagerAdapter adapter = new PagerAdapter(getActivity().getSupportFragmentManager());
        adapter.addTitle("体系");
        adapter.addTitle("导航");
        adapter.addFragment(new SetupTreeFragment("tree"));
        adapter.addFragment(new SetupItemFragment("navi"));
        setupPager.setAdapter(adapter);
        setupLayout.setupWithViewPager(setupPager);
        setupLayout.setSelectedTabIndicatorHeight(0);
    }

    @Override
    public void initData() {

    }

    @Override
    public void doBusiness() {

    }

    @Override
    public View titleBar() {
        return null;
    }


    @Override
    public Context getMContext() {
        return getMContext();
    }

}